home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / ib.606 < prev    next >
Text File  |  1992-02-06  |  2KB  |  68 lines

  1. {\rtf0\ansi{\fonttbl\f2\fnil Times-Roman;\f3\fmodern Courier;\f1\fswiss Helvetica;}
  2. \paperw11440
  3. \paperh8340
  4. \margl120
  5. \margr120
  6. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\b0\i0\ul0\fs28 custom loadable palette IB \
  7.     \
  8. Q:  In release 2.0, I've designed a custom palette in InterfaceBuilder which contains a subclass of View called MyView.  When I create a new application, load the palette and test it in Test Interface mode, everything looks fine.  When I do a make on the application there are no errors.  However, when I launch the application from the Workspace Manager it dies because the MyView object is not in the run module.  What am I doing wrong? \
  9.  
  10. \i     \
  11.  
  12. \i0 A:  When you create a loadable palette in IB with a special class like MyView, you need to also distribute the code (in some form) for that class.  This then needs to be linked into the application.  There are three ways to do this:\
  13. \
  14. 1) Distribute the 
  15. \f3 .m
  16. \f2  and 
  17. \f3 .h
  18. \f2  for the class.\
  19.     The user would then add these to the "[.hm] (class)" category of the project.\
  20.     \
  21.  
  22. \fi-260\li260 2) Distribute the 
  23. \f3 .o
  24. \f2  and 
  25. \f3 .h
  26. \f2  for the class.\
  27.     The user would then add the 
  28. \f3 .h
  29. \f2  to the ".h (other)" category of his project.  He would also add the 
  30. \f3 .o
  31. \f2  to the "Other files" category of his project AND create a Makefile.preamble which contains the following line:\
  32.  
  33. \fi0\li0     \
  34.  
  35. \f3\fs24     
  36. \fs28 OTHER_OFILES = MyView.o
  37. \fs24 \
  38.  
  39. \f2\fs28 \
  40.     <see Chapter 1 of DevTools "Putting Together" for more information>\
  41.     \
  42. 3) Distribute the 
  43. \f3 .h
  44. \f2  and a 
  45. \f3 .a
  46. \f2  which contains the class.\
  47.  
  48. \li320 The user would add the 
  49. \f3 .h
  50. \f2  to the ".h (other)" category of his project.  He would also add \
  51. the 
  52. \f3 .a
  53. \f2  to the "Other libs" category of his project.  In this implementation the library should be placed either in the project folder, /usr/lib or /usr/local/lib.  [The linker automatically searcher /usr/local/lib as well as /usr/lib when trying to link in libraries.  This provides a convenient way for you to keep your libraries and NeXT libraries separate.]\
  54.  
  55. \li0 \
  56. See also:  The InterfaceBuilder 2.0 Release notes for more information on \
  57.         building and using custom palettes.\
  58.          \
  59.           The examples in /NextDeveloper/Examples/InterfaceBuilder.\
  60.          [BlinkPalette and SketchPalette]\
  61. \
  62. QA606    \
  63. \
  64. Not valid for 1.0\
  65. Valid for 2.0            \
  66. \
  67.  
  68.